import Utils from "../experience/utils/Utils.js";
import Api from "../experience/api/Api.js";
import Db from "../experience/db/Db.js";
import Drawer from "../experience/drawer/Drawer.js";
import Algorithm from "../experience/utils/Algorithm.js";
import { app, _toast, _delay } from "../experience/utils/F7.js"
import Kriging from "../experience/utils/Kriging.js";
import Emitter from "../experience/utils/Emitter.js";

export default class Component {
    constructor() {
        this.utils = new Utils();
        this.api = new Api();
        this.db = new Db();
        this.drawer = new Drawer();
        this.algo = new Algorithm();
        this.kriging = new Kriging();
        this.emitter = new Emitter();

        this.$$ = Dom7;
        this.app = app;
        this.toast = _toast;
        this.delay = _delay;

        this.size();
        this.template();
        this.control();

        this.emitter.on("resize", () => {});
    }

    template() { throw new Error("没有实现组件的模板方法."); }

    control() { throw new Error("没有实现组件的控制器方法."); }

    size() {
        window.addEventListener("resize", () => {
            this.emitter.emit("resize");
        });
    }
}